


<template>
    <div class="model-form">
        <el-page-header @back="goBack" content="增加职位">
        </el-page-header>
        <div class="model-content">
            <el-form ref="ruleForm" :rules="rules" :model="form" label-width="160px">
                <el-row :gutter="10">
    <el-col :span="22">
            <el-form-item label="职位名称"  prop="name">
        <el-input v-model="form.name" name="name">
        </el-input>
            </el-form-item>

    </el-col>
    <el-col :span="22">
            <el-form-item label="招聘人数"  prop="num">
        <el-input-number v-model="form.num" name="num" :min="0" :max="9999999" style="width: 100%;"></el-input-number>
            </el-form-item>

    </el-col>
    <el-col :span="22">
            <el-form-item label="工资"  prop="wages">
        <el-input v-model="form.wages" name="wages">
        </el-input>
            </el-form-item>

    </el-col>
    <el-col :span="22">
            <el-form-item label="工作城市"  prop="workCity">
        <el-input v-model="form.workCity" name="workCity">
        </el-input>
            </el-form-item>

    </el-col>
    <el-col :span="22">
            <el-form-item label="联系方式"  prop="contactData">
        <el-input v-model="form.contactData" name="contactData" type="textarea"></el-input>
            </el-form-item>

    </el-col>
    <el-col :span="22">
            <el-form-item label="岗位职责"  prop="duty">
        <el-input v-model="form.duty" name="duty" type="textarea"></el-input>
            </el-form-item>

    </el-col>
    <el-col :span="22">
            <div style="margin-left: 160px;">
                <sc-editor v-model="form.note" placeholder="请输入" style="width: 100%;"  :height="400"></sc-editor>
            </div>

    </el-col>

                    <el-col :span="22">
                        <el-form-item>
                            <el-button @click="goBack">取消</el-button>
                            <el-button type="primary" @click="createData">确定</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </div>
    </div>
</template>

<script setup>
            import {defineAsyncComponent} from "vue";
            const scEditor = defineAsyncComponent(() => import('@/components/scEditor/index.vue'));
    import {ref} from "vue";
    import {useData} from "@/utils/useData";
    import {useCreate} from "@/uses/useCreate";

    const form = ref({
         name: null ,
         num: null ,
         wages: null ,
         workCity: null ,
         contactData: null ,
         duty: null ,
         note: null     })

    const rules = ref({
       name: [
           {required: true, message: '请输入职位名称', trigger: 'blur'}
       ],
    })

    const ruleForm = ref(null);

    const {createData,goBack} =useCreate("job",form,ruleForm)

</script>

<style scoped>
</style>